package cn.phecda.boot.tenant.core.properties;

import cn.phecda.boot.common.lang.constants.PropertyConstants;
import cn.phecda.boot.common.lang.model.TenantStrategy;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

/**
 * <p> 租户属性 </p>
 *
 * @author : wanpinwei
 */
@Data
@ConfigurationProperties(prefix = PropertyConstants.PROPERTY_PREFIX_TENANT)
public class TenantProperties {
    /**
     * 开启开关, 默认开启
     */
    private Boolean enabled = Boolean.FALSE;

    /**
     * 租户策略
     */
    private TenantStrategy strategy = TenantStrategy.TABLE;

    /**
     * 租户数据源，当租户策略是Databse时，必须设置
     */
    private Map<String, DataSourceConfig> datasources = new HashMap<>();

}
